<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.hengpeng.itfints.tools.PageUtil" %>
<% 
	PageUtil pageUtil = (PageUtil)request.getAttribute("PageUtil");
%>
<%@include file="/page/common/public.jspf"%>
<!DOCTYPE HTML>
<html>
<head>
<meta charset=utf-8" />
<title>会员中心-投资记录</title>
<link rel="stylesheet" type="text/css" href="${path}/css/base.css"/>
<link rel="stylesheet" type="text/css" href="${path}/css/layout.css"/>
<link href="${skin }/theme.css" rel="stylesheet" type="text/css" />
<link href="${skin }/member.css" rel="stylesheet" type="text/css" />
<script src="${path }/js/common/jquery1.10.2.min.js"></script>
<script src="${path }/js/common/helper.js?v=${v}"></script>
<script src="${path }/js/common/cookie.js?v=${v}"></script>
</head>
<body bgcolor="#f9f9f9">
        <!-- head -->
		<c:import url="../../include/top.jsp"></c:import>
    	<!--主体-->
        <div class="pageCenter registeredBox" style="overflow: auto;">
        	<div class="qyMsgBox">
        		<!--左边菜单  -->
            	<c:import url="../left.jsp"></c:import>
            	<!--左边菜单  -->
                <div class="qyMsgRight float_r">
                		<div class="auto_height" style="background: #fff;margin-bottom: 20px;">
							<div style="padding: 12px">
								<div class="hkjh_top_ul1_li1div1">投资记录</div>
							</div>
						
							<div class="hkjh_top_ul1_li1div2 l">
								<div class="hkjh_hking">投资金额</div>
								<div class="hkjh_count"><fmt:formatNumber value="${account.totalInvestMoney/100 }" type="currency" pattern="￥.00"/>
								</div>
							</div>
							
							<div class="hkjh_top_ul1_li1div2 l">
								<div class="hkjh_hking">投资笔数</div>
								<div class="hkjh_count">${account.totalInvestNum eq null ? '0' : account.totalInvestNum }笔</div>
							</div>
							
							<div class="hkjh_top_ul1_li1div2 r" style="width: 230px;border-right:none;">
								<div class="hkjh_hking">已收益</div>
								<div class="hkjh_dslx"><fmt:formatNumber value="${account.totalIncomeMoney/100}" type="currency" pattern="￥.00"/>
								</div>
							</div>
						</div>
						
						
						<div class="auto_height" style="background: #fff;margin-bottom: 20px;">
						<div style="padding: 12px">
							<div class="section query" style="display: ;">				
								<div class="thats">
									<div class="s_16">投资状态：</div>
									<input type="hidden" name="investInfoStatus" id="investInfoStatus" value="${investInfoStatus}"/>
									<c:choose> 
										 <c:when test="${investInfoStatus eq 'SUCESS'}"> 
										 	<span class="cllradio cllradio_sys"><a onclick="select('SUCESS')" href="javascript:void(0);" class="select"><i></i><em>已投标</em></a></span>
									      	<span class="cllradio cllradio_sys"><a onclick="select('LOANED')" href="javascript:void(0);" class="default"><i></i><em>回款中</em></a></span>
									        <span class="cllradio cllradio_sys"><a onclick="select('RETURNED')" lang="1" href="javascript:void(0);" class=default><i></i><em>已回款</em></a></span>
									     </c:when> 
									     <c:when test="${investInfoStatus eq 'RETURNED'}"> 
									     	<span class="cllradio cllradio_sys"><a onclick="select('SUCESS')" href="javascript:void(0);" class="default"><i></i><em>已投标</em></a></span>
									      	<span class="cllradio cllradio_sys"><a onclick="select('LOANED')" href="javascript:void(0);" class="default"><i></i><em>回款中</em></a></span>
									        <span class="cllradio cllradio_sys"><a onclick="select('RETURNED')" lang="1" href="javascript:void(0);" class=select><i></i><em>已回款</em></a></span>
									     </c:when> 
									     <c:when test="${investInfoStatus eq 'LOANED'}"> 
									     	<span class="cllradio cllradio_sys"><a onclick="select('SUCESS')" href="javascript:void(0);" class="default"><i></i><em>已投标</em></a></span>
									      	<span class="cllradio cllradio_sys"><a onclick="select('LOANED')"  href="javascript:void(0);" class="select"><i></i><em>回款中</em></a></span>
									        <span class="cllradio cllradio_sys"><a onclick="select('RETURNED')"  lang="1" href="javascript:void(0);" class=default><i></i><em>已回款</em></a></span>
									     </c:when> 
									     <c:otherwise> 
									     	<span class="cllradio cllradio_sys"><a onclick="select('SUCESS')" href="javascript:void(0);" class="default"><i></i><em>已投标</em></a></span>
									      	<span class="cllradio cllradio_sys"><a onclick="select('LOANED')"  href="javascript:void(0);" class="select"><i></i><em>回款中</em></a></span>
									        <span class="cllradio cllradio_sys"><a onclick="select('RETURNED')"  lang="1" href="javascript:void(0);" class=default><i></i><em>已回款</em></a></span>
									     </c:otherwise>
								    </c:choose>
								</div>
							</div>
						</div>
							<ul class="account_item_title">
								<li style="text-align:center;width:96px;">标的名称</li>
								<li>年化率</li>
								<li>投资时间</li>
								<li>投资金额</li>
								<li>
									<c:choose> 
										 <c:when test="${investInfoStatus eq 'SUCESS'}">附加利率</c:when> 
									     <c:when test="${investInfoStatus eq 'RETURNED'}">已收本金</c:when> 
									     <c:when test="${investInfoStatus eq 'LOANED'}">待收本金</c:when> 
									     <c:otherwise>待收本金</c:otherwise>
								    </c:choose>
								</li>
								<li>
								    <c:choose> 
								    	 <c:when test="${investInfoStatus eq 'SUCESS'}">融资进度</c:when> 
									     <c:when test="${investInfoStatus eq 'RETURNED'}">已收利息</c:when> 
									     <c:when test="${investInfoStatus eq 'LOANED'}">待收利息</c:when> 
									     <c:otherwise>待收利息</c:otherwise>
								    </c:choose>
								</li>
								<li>状态</li>
								<li style="width:92px;text-align:center;">合同</li>
							</ul>
							<c:choose> 
							     <c:when test="${fn:length(myInvestList) > 0}"> 
							      		<c:forEach items="${myInvestList}" var="invest" begin="<%=pageUtil.getFromIndex()%>" end="<%=pageUtil.getToIndex() %>" varStatus="vstatus">
											<c:choose>
									            <c:when test="${vstatus.index%2 == 0}">
									  				<ul class="account_item_title2">
														<li style="text-align:center;width:96px;">
															<a href="javascript:void(0);" onclick="myreceiveplan('${invest.borrowInfoId}','${invest.investUserId}')" class="d_blue">
																<c:choose> 
																     <c:when test="${fn:length(invest.borrowName) > 6}"> 
																      	<c:out value="${fn:substring(invest.borrowName, 0, 6)}..." /> 
																     </c:when> 
																     <c:otherwise> 
																      	<c:out value="${invest.borrowName}" /> 
																     </c:otherwise>
															    </c:choose>
															</a>
														</li>
														<li>${invest.borrowRate}% </li>
														<li><fmt:formatDate value="${invest.investTime}" type="both" pattern="yyyy/MM/dd"/></li>
														<li><fmt:formatNumber value="${invest.investMoney/100}" type="currency" pattern="￥.00"/>
														</li>
														
														<li>
															<c:choose> 
																 <c:when test="${investInfoStatus eq 'SUCESS'}">
															     	${invest.rewardRate }%
															     </c:when>
															     <c:when test="${investInfoStatus eq 'RETURNED'}">
															     	<fmt:formatNumber value="${invest.receivedBaseMoney/100}" type="currency" pattern="￥.00"/>
															     </c:when> 
															     <c:when test="${investInfoStatus eq 'LOANED'}">
															     	<fmt:formatNumber value="${invest.unReceiveBaseMoney/100}" type="currency" pattern="￥.00"/>
															     </c:when> 
															     <c:otherwise>
															     	<fmt:formatNumber value="${invest.receivedBaseMoney/100}" type="currency" pattern="￥.00"/>
															     </c:otherwise>
														    </c:choose>
														</li>
														<li>
															<c:choose> 
																 <c:when test="${investInfoStatus eq 'SUCESS'}">
															     	${invest.raiseProgress}%
															     </c:when>
															     <c:when test="${investInfoStatus eq 'RETURNED'}">
															     	<fmt:formatNumber value="${invest.receivedInterestMoney/100}" type="currency" pattern="￥.00"/>
															     </c:when> 
															     <c:when test="${investInfoStatus eq 'LOANED'}">
															     	<fmt:formatNumber value="${invest.unReceiveInterestMoney/100}" type="currency" pattern="￥.00"/>
															     </c:when> 
															     <c:otherwise>
															     	<fmt:formatNumber value="${invest.receivedInterestMoney/100}" type="currency" pattern="￥.00"/>
															     </c:otherwise>
														    </c:choose>
														</li>
														<li>
															<c:choose> 
																 <c:when test="${investInfoStatus eq 'SUCESS'}">投标成功</c:when>
															     <c:when test="${investInfoStatus eq 'RETURNED'}">已回款</c:when> 
															     <c:when test="${investInfoStatus eq 'LOANED'}">回款中</c:when> 
															     <c:otherwise>回款中</c:otherwise>
														    </c:choose>					
														</li>
														<li style="width:92px;text-align:center;"><a href="#" class="d_blue">查看</a></li>
													</ul>
									            </c:when>
									            <c:otherwise>
									    			<ul class=account_item_title3>
														<li style="text-align:center;width:96px;">
															<a href="javascript:void(0);" onclick="myreceiveplan('${invest.borrowInfoId}','${invest.investUserId}')" class="d_blue">
																<c:choose> 
																     <c:when test="${fn:length(invest.borrowName) > 6}"> 
																      	<c:out value="${fn:substring(invest.borrowName, 0, 6)}..." /> 
																     </c:when> 
																     <c:otherwise> 
																      	<c:out value="${invest.borrowName}" /> 
																     </c:otherwise>
															    </c:choose>
															</a>
														</li>
														<li>${invest.borrowRate}%</li>
														<li><fmt:formatDate value="${invest.investTime}" type="both" pattern="yyyy/MM/dd"/></li>
														<li><fmt:formatNumber value="${invest.investMoney/100}" type="currency" pattern="￥.00"/>
														</li>
														
														<li>
															<c:choose>
															     <c:when test="${investInfoStatus eq 'SUCESS'}">
															     	${invest.rewardRate }%
															     </c:when> 
															     <c:when test="${investInfoStatus eq 'RETURNED'}">
															     	<fmt:formatNumber value="${invest.receivedBaseMoney/100}" type="currency" pattern="￥.00"/>
															     </c:when> 
															     <c:when test="${investInfoStatus eq 'LOANED'}">
															     	<fmt:formatNumber value="${invest.unReceiveBaseMoney/100}" type="currency" pattern="￥.00"/>
															     </c:when> 
															     <c:otherwise><fmt:formatNumber value="${invest.receivedBaseMoney/100}" type="currency" pattern="￥.00"/></c:otherwise>
														    </c:choose>
														</li>
														<li>
															<c:choose>
																 <c:when test="${investInfoStatus eq 'SUCESS'}">
															     	${invest.raiseProgress}%
															     </c:when>
															     <c:when test="${investInfoStatus eq 'RETURNED'}">
															     	<fmt:formatNumber value="${invest.receivedInterestMoney/100}" type="currency" pattern="￥.00"/>
															     </c:when> 
															     <c:when test="${investInfoStatus eq 'LOANED'}">
															     	<fmt:formatNumber value="${invest.unReceiveInterestMoney/100}" type="currency" pattern="￥.00"/>
															     </c:when> 
															     <c:otherwise><fmt:formatNumber value="${invest.receivedInterestMoney/100}" type="currency" pattern="￥.00"/></c:otherwise>
									  				        </c:choose>
														</li>
														<li>
															<c:choose> 
																 <c:when test="${investInfoStatus eq 'SUCESS'}">投标成功</c:when>
															     <c:when test="${investInfoStatus eq 'RETURNED'}">已回款</c:when> 
															     <c:when test="${investInfoStatus eq 'LOANED'}">回款中</c:when> 
															     <c:otherwise>回款中</c:otherwise>
														    </c:choose>
														</li>
														<li style="width:92px;text-align:center;"><a href="#" class="d_blue">查看</a></li>
													</ul>
									            </c:otherwise>
									        </c:choose>
										</c:forEach>  
							     </c:when> 
							     <c:otherwise> 
							      		<div class="s_13" style="clear: both;">
											<div style="line-height: 60px; font-size: 16px; text-align: center;">暂无投资记录</div>
										</div>
							     </c:otherwise>
						    </c:choose>
							<div class="clearfix section"></div>
							
						<div class="paginations">
							<div class="page-bottom">
								记录总数<%=pageUtil.getTotalCount()%>条 当前页/总页数<%=pageUtil.getCurrentPage()%> 
								/<%=pageUtil.getPageCount()%>每页显示<%=pageUtil.getPageSize()%>条 
								<a onclick="javascript:go(1);" href="javascript:void(0);" name="pagebar_frist" class="page-start"><span>首页</span></a> 
								<a onclick="javascript:go(<%=(pageUtil.getCurrentPage() - 1)%>);" href="javascript:void(0);" name="pagebar_pre" class="page-prev"><span>上一页</span></a> 
								<a onclick="javascript:go(<%=(pageUtil.getCurrentPage() + 1)%>);" href="javascript:void(0);" name="pagebar_next" class="page-next"><span>下一页</span></a> 
								<a onclick="javascript:go(<%=pageUtil.getPageCount()%>);" href="javascript:void(0);" name="pagebar_last" class="page-end"><span>末页</span></a> 
							</div>
						</div>
                </div>
                <div class="clear"></div> 
         	</div>       
        </div>
        </div>
        
    	<!--主体-->
    	<!--foot-->
        <c:import url="../../include/foot.jsp"></c:import>
        <!--foot-->  
<script type="text/javascript">
	//分页
	function go (page) {
		window.location.href = "<%=request.getContextPath()%>/investInfo/myInvestList.htm?curPage="+page+"&investInfoStatus="+$("#investInfoStatus").val();
	}
	//状态查询
	function select (investInfoStatus) {
		window.location.href = "<%=request.getContextPath()%>/investInfo/myInvestList.htm?curPage=1&investInfoStatus="+investInfoStatus;
	}
	//查看收款计划
	function myreceiveplan (borrowInfoId, userId) {
		window.location.href = "<%=request.getContextPath()%>/repayment/myReceivePlanList.htm?borrowInfoId="+borrowInfoId+"&investUserId="+userId;
	}
</script> 
</body>
</html>

